class Sequence < DefinitionPart
  def fetch
    value = (position + inc)
    self.position = value
    self.save! # hantera exception here
    return zerolize(value.to_s)
  end
  
  def zerolize(value)
    val_length = value.to_s.length
    zeros_to_add = self.seq_dimension - val_length
    zeros_to_add.times { value.insert(0, "0") }
    return value
  end
end
